Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move iconify to before setting alpha (#236) #428

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

laggykiller
Copy link

This PR is written to solve #236.

Below is an exerpt from my response the issue:


If self._toplevel is created with iconify=True, then execution is stuck until opening back the window. This is caused by src/ttkbootstrap/window.py Window.init and Toplevel.init:

# Function continue above...

if iconify:
    self.iconify()

# Function continues...

if alpha is not None:
    if self.winsys == 'x11':
        self.wait_visibility(self)
    self.attributes("-alpha", alpha)

# Function continue below...

Linux uses x11 display system. The Window/Toplevel was iconified before setting alpha, which causes wait_visibility() to get stuck until user open back the window. Hence, deiconify() in src/ttkbootstrap/dialogs/dialogs Dialog.build could not be called until user open back the window.

It seems like the visbility check is introduced by 2abfeb4 in response to #108 so removing that check is not an option.


This PR would swap iconify() and set alpha such that alpha is set when 'visbible' before iconifying. Note that iconify() has to be called before self.transient(transient) to avoid error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant